// 切换导航栏显示
document.querySelector('.toggle-sidebar-btn').addEventListener('click', function () {
    document.querySelector('.sidebar').classList.toggle('hidden');
});
// 页面加载时检查用户偏好
document.addEventListener('DOMContentLoaded', (event) => {
    if (localStorage.getItem('darkMode') === 'true') {
        document.body.classList.add('dark-mode');
    }
});
// 切换暗色模式并保存偏好
document.getElementById('toggleDarkMode').addEventListener('click', function () {
    var isDarkMode = document.body.classList.toggle('dark-mode');
    localStorage.setItem('darkMode', isDarkMode);
});
document.querySelector('.toggle-sidebar-btn').addEventListener('click', function () {
    document.querySelector('.sidebar').classList.toggle('-translate-x-full');
});